package com.kgcx.dbutils.config;

import com.kgcx.dbutils.utils.CommonMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.autoconfigure.MapperProperties;

import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.List;

@Component
public class CommonMapperConfig {
    @Autowired
    private MapperProperties properties;

    @PostConstruct
    public void loadMappers() {
        List<Class> list = new ArrayList<>();
        list.add(CommonMapper.class);
        properties.setMappers(list);
        properties.setNotEmpty(true);
    }

}

